package org.gw.ylc.base.util;

import java.util.Arrays;
import java.util.List;

public class StringArrayUtil {
	public static boolean isSubArray(String subject, String master) {
		return isSubArray(subject == null ? new String[0] : subject.split(","),
				master == null ? new String[0] : master.split(","));
	}

	public static boolean isSubArray(String[] subject, String[] master) {
		List<String> asList = Arrays.asList(master);
		for (String s : subject) {
			if (!asList.contains(s)) {
				return false;
			}
		}
		return true;
	}

	public static String lowerCaseFirst(String str) {
		if (str != null && str.length() > 0) {
			return str.substring(0, 1).toLowerCase() + str.substring(1);
		}
		return str;
	}
}
